package cn.smbms.mapper;

import cn.smbms.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    //查询全部
    public List<User> getAll();

    //查询数量
    public int getCount();
    //根据用户名模糊查询
    public List<User> getByUserName(String userName);
    //根据用户名和角色进行查新
    public List<User> getByUserNameAndUserRole(User user);
    //根据map进行查新
    public List<User> getByMap(Map<String, Object> map);
    //返回resultMap映射
    public List<User> getUserRole(User user);
    //添加
    public int add(User user);
    //修改
    public int upd(User user);
    //删除
    public int del(int id);

    public int updPwdById(@Param("pwd") String userPassword, @Param("id") int id);

    public List<User> getUserAddress();

    public List<User> getUsersByroles(Map<String, Object> map);

    public List<User> getUsersChoose(User user);

    public List<User> getUserPage(@Param("userName") String username,
                                  @Param("userRole") Integer userRole,
                                  @Param("from") Integer from,
                                  @Param("pageSize") Integer pageSize);

}
